%% Listing
\usepackage{listings}
\lstset{columns=[l]flexible}
\lstset{commentstyle=\textit}
\lstset{captionpos=b}
\lstset{backgroundcolor=\color{lightgray}}
\lstset{frame=single}
\lstset{framesep=4pt}
\lstset{framerule=0pt}
%\lstset{basicstyle=\ttfamily\footnotesize}
\lstset{basicstyle=\normalfont\footnotesize}
\lstset{xleftmargin=1em}
\lstset{xrightmargin=1em}

%%% Assembly
%\lstdefinelanguage[gas]{Assembler}{
%        morekeywords=[1]{
%                ENTRY,  END,    macro,  %
%                je,     jne,    jz,     jnz,    jne,    %
%                jae,    push,   pop,    ret,    mov,    %
%                jmp,    call,   cmp,    add,    sub,    %
%                jmpq,   callq,  cmpq,   addq,   subq,   %
%                rax,    rbx,    rcx,    rdx,    rdi,    %
%                rsi,    r8,     r9,     r10,    r11,    %
%                r12,    r13,    r14,    r15,    movq,   %
%                pushq,  popq,                           %
%                equ,    globl,  long,   word,   align,  %
%                b,      ldr,    swi,    subs,   stmia,  %
%                mrs,    msr,    and,    add,    movs,   %
%                macro,  endm,                           %
%        },
%}[keywords,comments,strings]
%\newcommand{\inputasmlisting}[3]{
%        \lstinputlisting[language={[gas]Assembler},
%                         caption={#2},
%                         label={src:#3}]{#1}}

%%% C 
\newcommand{\inputclisting}[3]{
        \lstinputlisting[language={C},
                         caption={#2},
                         showstringspaces=false,
                         label={src:#3}]{#1}}
